﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Addmin_AddminChangerPassword : System.Web.UI.Page
{
    VendorMethord VM = new VendorMethord();
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["AdminName"] == null)
        {
            Response.Redirect("~/LoginManager.aspx");
        }
    }
    protected void btnok_Click(object sender, EventArgs e)
    {
        string use = Session["AdminName"].ToString();
        DataTable dt = VM.getIDemploy(use.ToString());
        int emid = Convert.ToInt32(dt.Rows[0][0].ToString());
        bool resurt = VM.ChangePasswordManager(emid, txtnewpassword.Text);
        if (resurt)
        {
            lblMsg.Text = "Change Successfull";
        }
        else
        {
            lblMsg.Text = "Change Unsuccessfull";
        }
    }
}